#!/usr/bin/expect

spawn ssh -o "StrictHostKeyChecking no" manager@192.168.1.1
expect "password:"
send "123456\r"
expect "root"
send "cd ~/bin\r"
interact